//
//  UIBarButtonItem + extension.swift
//  WeiBo09
//
//  Created by 裘明 on 15/9/20.
//  Copyright © 2015年 qm. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    
    
    convenience init(imageName: String, target: AnyObject?, actionName: String?) {
        
        let button = UIButton(imageName: imageName)
        
        if target != nil && actionName != nil {
            
            button.addTarget(target, action: Selector(actionName!), forControlEvents: UIControlEvents.TouchUpInside)
        }
        
        self.init(customView: button)
    }
    

    
    
}